// import SockJS from "sockjs-client";
// import Stomp from "stompjs";

var stompClient = null;
new Vue({
    el: "#foo",

    data: function () {
        return {}

    },
    mounted: function () {
        this.joinRoom();
    },
    methods: {
        joinRoom: function () {
            console.log(123);
            let that = this;
            let socket = new SockJS('http://127.0.0.1:8080/fooServer');
            stompClient = Stomp.over(socket);
            stompClient.connect({}, function () {

                that.sendMessage('join/DFSFDS/2332', location.href);
                console.log(location.href);
                stompClient.subscribe('/topic/notice', function (response) {
                    alert(response.data);
                });
                // that.sendMessage();
            });
        },
        sendMessage: function (url, obj) {
            stompClient.send("/app/" + url, {}, JSON.stringify(obj));
        }
    },
});